import { SocketHelper } from "./SocketHelper";
/**
 * Created by Yamazhiki on 11/01/2017.
 */
export const User_None = 0;
export const User_LoginByUid = 1;
export const User_LoginByCode = 2;
export class Tcm_User_LoginByUid {
    constructor(obj) {
        this.uid = obj.uid;
        this.token = obj.token;
    }
    toBuffer() {
        let buffer = Buffer.allocUnsafe(73);
        let write = new SocketHelper();
        write.putUInt64(buffer, this.uid);
        write.putString(buffer, this.token, 65);
        return buffer;
    }
}
export class Tcm_User_LoginByCode {
    constructor(obj) {
        this.uid = obj.uid;
        this.userCode = obj.userCode;
    }
    toBuffer() {
        let buffer = Buffer.allocUnsafe(41);
        let write = new SocketHelper();
        write.putUInt64(buffer, this.uid);
        write.putString(buffer, this.userCode, 33);
        return buffer;
    }
}
export class Tsm_User_Login {
    constructor(buffer) {
        let read = new SocketHelper();
        this.errorNo = read.getInt(buffer);
        this.uid = read.getUInt64(buffer);
        this.goldCount = read.getInt64(buffer);
        this.rechargeGold = read.getInt64(buffer);
        this.giftGold = read.getInt64(buffer);
        this.userCode = read.getString(buffer, 33);
    }
}
